package com.ccrfid.rmc6.repository.sys;

import com.ccrfid.rmc6.entity.sys.AccountRoleRelation;
import org.springframework.data.repository.Repository;

import java.util.List;

public interface AccountRoleRelationRepository extends Repository<AccountRoleRelation, Long> {
    //
    void deleteByRoleId(Long roleId);
    void deleteByAccountId(Long accountId);
    void deleteByAccountIdAndRoleId(Long accountId, Long roleId);
    //
    Boolean existsByAccountIdAndRoleId(Long accountId, Long roleId);
    //
    List<AccountRoleRelation> getAllByAccountId(Long accountId);
    //
    AccountRoleRelation save(AccountRoleRelation relation);
}
